package org.dicr.traffic.filter;

import org.dicr.traffic.source.*;

/**
 * Traffic Rule
 * 
 * @author <A href='http://dicr.org'>Igor A Tarasov</A>
 * @version 060703
 */
public interface TrafficRule {
	/**
     * Set rule action
     * 
     * @param action action to apply to traffic element if rule is match
     */
	public void setAction(FilterAction action);

	/**
     * Return rule action
     * 
     * @return action to apply to traffic element if this rule is match
     */
	public FilterAction getAction();

	/**
     * Match element agains this rule.
     * 
     * @param el traffic element to match or not
     * @return true if element match this rule
     */
	public boolean matchElement(TrafficElement el);

	/**
     * Return matched bytes count
     * 
     * @return bytes count of all matched elements
     */
	public long getMatchBytesCounter();

	/**
     * Reset bytes counters
     */
	public void resetBytesCounters();
}
